Skip to content

feat: replace wifi-commissioning-gatt-service with wifi-commissioning-service#639

Merged
JanZachmann merged 7 commits intoomnect:mainfrom
JanZachmann:update-wifi-comm
Mar 31, 2026
Merged

feat: replace wifi-commissioning-gatt-service with wifi-commissioning-service#639
JanZachmann merged 7 commits intoomnect:mainfrom
JanZachmann:update-wifi-comm

Conversation

@JanZachmann
Copy link
Copy Markdown
Contributor

@JanZachmann JanZachmann commented Mar 17, 2026

Replace wifi-commissioning-gatt-service (v0.4.4) with wifi-commissioning-service (v0.1.0), a complete rewrite providing dual transport: BLE GATT and an HTTP REST API over a Unix domain socket (via actix-web).

Image inclusion

The service is included in the image when DISTRO_FEATURES contains wifi-commissioning.
Note: wifi and bluetooth are not added to DISTRO_FEATURES automatically and must be set explicitly.

BLE GATT transport

BLE GATT is enabled only when DISTRO_FEATURES contains bluetooth.
When bluetooth is absent, the service is started with --no-enable-ble and bluez5 is not pulled in as a runtime dependency.

Permission concept

  • Service runs as system user wifi_commissioning (no home, no login shell), primary group wifi_commissioning
  • SupplementaryGroups=wpa_supplicant is injected into the service unit so the service can access the wpa_supplicant control socket at /var/run/wpa_supplicant/<iface>
  • The Unix socket is owned by group omnect_device_service_client (GID 10000), allowing containers that run with UID 10000 as their primary group to access the REST API socket without additional group membership changes

Changes

  • Remove wifi-commissioning-gatt-service recipe (_0.4.4.bb + .inc)
  • Add wifi-commissioning-service recipe (_0.1.0.bb + .inc) with:
    • Cargo build with --locked --features systemd
    • Conditional bluez5 (>=5.60) runtime dependency based on bluetooth DISTRO_FEATURE
    • Systemd .service and .socket units installed and enabled
  • Add classes/wifi-commissioning-service.bbclass for wifi_commissioning user/group creation via useradd
  • Update bluez5_%.bbappend to reference new service unit name
  • Update omnect-os-image.bb package reference
  • Update README.md

- Update RUSTVERSION, source checksum, and bootstrap snapshots (1.92.0)
- Update LLVM from 20.1.1 to 21.1.8
- Rename recipe files from 1.87.0 to 1.93.0
- Fix target spec integer fields for Rust 1.93+ (oe.patch, oe_rust-target-config.patch)
- Fix -fcanon-prefix-map GCC compatibility and llvm-tools install in rust_1.93.0.bb
- Fix dead_code and unused_parens linter findings for aziot-identityd,
  aziot-edged, and iotedge packages

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann changed the title WIP: Update wifi comm feat: add wifi-commissioning-service recipe Mar 17, 2026
@JanZachmann JanZachmann changed the title feat: add wifi-commissioning-service recipe feat: replace wifi-commissioning-gatt-service with wifi-commissioning-service Mar 17, 2026
Replace wifi-commissioning-gatt-service with wifi-commissioning-service,
a complete rewrite that provides:
- Dual transport: BLE GATT + Unix Domain Socket with JSON-RPC 2.0
- Multi-socket container access for UID 10000 (omnect_device_service_client)
- Follows omnect patterns for user/group management

Changes:
- Add wifi-commissioning-service recipe infrastructure
  - Main recipe with cargo dependencies
  - Configuration .inc file with systemd unit installation
  - tmpfiles.d for runtime directory creation
  - BBClass for user/group management with pkg_postinst_ontarget

- Update bluez5 integration to reference new service name

- User/Group setup:
  - wifi_commissioning: service user and primary group
  - wifi_commissioning_client: socket access group
  - omnect_device_service_client added to wifi_commissioning_client
    at first boot to enable multi-socket container access

- Socket configuration:
  - SocketGroup changed from wpa_supplicant to wifi_commissioning_client
    to enable container access (UID 10000)

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann requested a review from mlilien March 17, 2026 14:36
@JanZachmann JanZachmann requested a review from mlilien March 18, 2026 19:47
Copy link
Copy Markdown
Contributor

@mlilien mlilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#639 (comment)
btw: your re-request was made without a prior push. so i can't resolve any of the issues.

Copy link
Copy Markdown
Contributor

@mlilien mlilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the desription mentions:

The service is included in the image when DISTRO_FEATURES contains wifi-commissioning.
Note: wifi and bluetooth are not added to DISTRO_FEATURES automatically and must be set explicitly.

seems we should at least only allow wifi-commissioning if wifi is set.

- Inline bbclass useradd logic into .inc, remove bbclass
- Fix bluez5 bbappend: update stale template name to non-template unit
- Add wpa_supplicant@wlan0 template instance override via sed
- Conditionally strip bluetooth deps and inject --disable-ble
- Reword README transport maturity (v0.1.0/early development)
- Update SRCREV for upstream CLI and systemd unit changes

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann
Copy link
Copy Markdown
Contributor Author

JanZachmann commented Mar 20, 2026

the desription mentions:

The service is included in the image when DISTRO_FEATURES contains wifi-commissioning.
Note: wifi and bluetooth are not added to DISTRO_FEATURES automatically and must be set explicitly.

seems we should at least only allow wifi-commissioning if wifi is set.

I hope I got your comment correct. Added a build-time check in the recipe .inc — bitbake will now fail with a clear error if wifi-commissioning is in DISTRO_FEATURES but wifi is not.

@JanZachmann JanZachmann requested a review from mlilien March 20, 2026 07:52
Update recipe and bluez5 bbappend for template-based service/socket
units (wifi-commissioning-service@.service / @.socket).

- Install @.service / @.socket template files
- Enable wlan0 instance via symlinks in target.wants
- Remove wpa_supplicant sed (upstream template has @%i dep)
- Update bluez5 PartOf to instance name @wlan0
- Update SRCREV for upstream template conversion

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

@JanZachmann JanZachmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a python() guard in the .inc that calls bb.fatal() if wifi-commissioning is set without wifi in DISTRO_FEATURES. Build will fail early with a clear error message.

SocketGroup, SupplementaryGroups, and Requires=bluetooth are now
hardcoded in the upstream unit files. Recipe only patches for
bluetooth-absent builds.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann requested a review from mlilien March 30, 2026 18:48
Copy link
Copy Markdown
Contributor

@mlilien mlilien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann merged commit d349a4d into omnect:main Mar 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants